
#include "HashFunctions.h"
#include <stdlib.h>

unsigned __int32 ttg_internal::extras::serialization::hashFunc(const char *name, size_t size)
{
	unsigned __int32 res = (unsigned __int32)size;
	if (name != NULL)
	{
		size_t i = 0;
		while (name[i] != '\0')
		{
			res ^= (name[i] + i) << (i % 20);
			i++;
		}
	}
	res ^= res >> 30;
	return res;
}